package com.yao.spider;

import com.yao.spider.proxy.ProxyHttpClient;
import com.yao.spider.proxy.ProxyPool;
import com.yao.spider.zhihu.ZhiHuHttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by 单耀 on 2017/12/24.
 */
public class StartClass {
    static boolean flag = true;
    private static final Logger logger = LoggerFactory.getLogger(StartClass.class);
    public static void main(String[] args) {
        ProxyHttpClient.getInstance().startGetProxy();


        /*new Thread(new Runnable() {
            public void run() {
                while (flag) {
                    if (ProxyPool.proxyQueue.size() >= 20) {
                        //关闭测试代理线程池
                        ProxyHttpClient.getInstance().getProxyTestThreadExector().shutdownNow();
                        //关闭下载代理线程池
                        ProxyHttpClient.getInstance().getProxyTestThreadExector().shutdownNow();
                        flag = false;
                        ProxyHttpClient.isContinue = false;
                        ZhiHuHttpClient.getInstance().startSpiderZhiHu();
                    }
                }
            }
        }).start();*/
        ZhiHuHttpClient.getInstance().startSpiderZhiHu();
    }
}
